<script type="text/html" template lay-done="layui.data.sendParams(d.params)">
    <div class="layui-form" lay-filter="form_entity">
        <input type="hidden" name="id" value="{{ d.params.id || ''}}">
        <div class="layui-form-item">
            <label class="layui-form-label">快递名称</label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" name="express_name"
                       value="{{d.params.express_name || ''}}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">物流单号</label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" name="logistics_no"
                       value="{{d.params.logistics_no || ''}}">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-footer">
                <label class="layui-form-label"></label>
                <div class="layui-input-inline">
                    <input type="button" lay-submit lay-filter="submit_entity" value="确认" class="layui-btn">
                </div>
            </div>
        </div>
    </div>
</script>

<script>
    layui.data.sendParams = function (obj) {
        layui.use(['fox_upload', 'wangEditor'], function () {
            let $ = layui.$
                , fox_upload = layui.fox_upload
                , admin = layui.admin
                , editor = layui.wangEditor

            //上传控件初始化
            fox_upload.render({
                elem: '#logo_url'
                , url: 'agent-admin/products/image'
                , headers: {
                    Authorization: admin.getAccessToken('Bearer')
                }
                , text: '点击上传'
                , name: 'logo_url'
                , value: obj.logo_url
            })

            //编辑器
            editor.render({
                elem: "#description"
                , height: 300
                , name: 'description'
                , url: 'editor/images'
            });
        })
    }
</script>
